inherited fmDeals: TfmDeals
  Left = 0
  Top = 0
  Caption = #1057#1076#1077#1083#1082#1080
  ClientHeight = 509
  ClientWidth = 964
  Position = poDesigned
  OnShow = FormShow
  ExplicitWidth = 972
  ExplicitHeight = 536
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 482
    Width = 964
    ExplicitTop = 482
    ExplicitWidth = 964
  end
  inherited Panel1: TPanel
    Top = 437
    Width = 964
    Visible = False
    ExplicitTop = 437
    ExplicitWidth = 964
  end
  object tbTop: TToolBar [2]
    Left = 0
    Top = 0
    Width = 964
    Height = 30
    AutoSize = True
    BorderWidth = 2
    Images = DMInv.ilActive
    TabOrder = 2
    Transparent = True
    object tbInsert: TToolButton
      Left = 0
      Top = 0
      Hint = #1044#1086#1073#1072#1074#1080#1090#1100
      ImageIndex = 0
      ParentShowHint = False
      ShowHint = True
      OnClick = tbInsertClick
    end
    object tbDelete: TToolButton
      Left = 23
      Top = 0
      Hint = #1059#1076#1072#1083#1080#1090#1100
      ImageIndex = 1
      ParentShowHint = False
      ShowHint = True
      OnClick = tbDeleteClick
    end
    object tbEdit: TToolButton
      Left = 46
      Top = 0
      Hint = #1048#1079#1084#1077#1085#1080#1090#1100
      ImageIndex = 2
      ParentShowHint = False
      ShowHint = True
      OnClick = tbEditClick
    end
    object ToolButton3: TToolButton
      Left = 69
      Top = 0
      Width = 8
      Caption = 'ToolButton3'
      ImageIndex = 2
      Style = tbsSeparator
    end
    object tbRefresh: TToolButton
      Left = 77
      Top = 0
      Hint = #1054#1073#1085#1086#1074#1080#1090#1100' '#1076#1072#1085#1085#1099#1077
      ImageIndex = 8
      ParentShowHint = False
      ShowHint = True
      OnClick = tbRefreshClick
    end
    object ToolButton8: TToolButton
      Left = 100
      Top = 0
      Width = 8
      Caption = 'ToolButton8'
      ImageIndex = 6
      Style = tbsSeparator
    end
    object tbPrintDoc: TToolButton
      Left = 108
      Top = 0
      Caption = 'tbPrintDoc'
      ImageIndex = 11
      OnClick = tbPrintDocClick
    end
    object ToolButton5: TToolButton
      Left = 131
      Top = 0
      Width = 8
      Caption = 'ToolButton5'
      ImageIndex = 5
      Style = tbsSeparator
    end
    object tbFindDeals: TToolButton
      Left = 139
      Top = 0
      Hint = #1055#1086#1080#1089#1082' '#1089#1076#1077#1083#1082#1080
      Caption = 'tbFindDeals'
      ImageIndex = 12
      OnClick = tbFindDealsClick
    end
    object ToolButton7: TToolButton
      Left = 162
      Top = 0
      Width = 8
      Caption = 'ToolButton7'
      ImageIndex = 6
      Style = tbsSeparator
    end
    object cbSend: TComboBox
      Left = 170
      Top = 0
      Width = 233
      Height = 21
      AutoDropDown = True
      Style = csDropDownList
      DropDownCount = 20
      ItemHeight = 13
      TabOrder = 0
      OnChange = cbSendChange
    end
    object ToolButton1: TToolButton
      Left = 403
      Top = 0
      Width = 8
      Caption = 'ToolButton1'
      ImageIndex = 3
      Style = tbsSeparator
    end
    object cbDest: TComboBox
      Left = 411
      Top = 0
      Width = 233
      Height = 21
      AutoDropDown = True
      Style = csDropDownList
      DropDownCount = 20
      ItemHeight = 13
      TabOrder = 1
      OnChange = cbDestChange
    end
    object ToolButton2: TToolButton
      Left = 644
      Top = 0
      Width = 7
      Caption = 'ToolButton2'
      ImageIndex = 4
      Style = tbsSeparator
    end
    object cbAll: TCheckBox
      Left = 651
      Top = 0
      Width = 42
      Height = 22
      Caption = #1042#1089#1077
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clNavy
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 2
    end
    object ToolButton4: TToolButton
      Left = 693
      Top = 0
      Width = 8
      Caption = 'ToolButton4'
      ImageIndex = 5
      Style = tbsSeparator
    end
    object cbFilter: TCheckBox
      Left = 701
      Top = 0
      Width = 76
      Height = 22
      Caption = #1060#1080#1083#1100#1090#1088#1099
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clNavy
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 3
      OnClick = cbFilterClick
    end
  end
  object dbgDeals: TcxGrid [3]
    Left = 0
    Top = 30
    Width = 964
    Height = 407
    Align = alClient
    TabOrder = 3
    LevelTabs.Style = 9
    LookAndFeel.Kind = lfStandard
    RootLevelOptions.DetailTabsPosition = dtpTop
    object dbgDealsDBTableView1: TcxGridDBTableView
      OnDblClick = dbgDealsDBTableView1DblClick
      OnKeyDown = dbgDealsDBTableView1KeyDown
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      DataController.DataModeController.GridMode = True
      DataController.DataSource = dlgDS
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <>
      DataController.Summary.SummaryGroups = <>
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsBehavior.IncSearch = True
      OptionsData.Deleting = False
      OptionsData.Inserting = False
      OptionsView.Navigator = True
      OptionsView.NavigatorOffset = 10
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.ColumnAutoWidth = True
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      OptionsView.ShowColumnFilterButtons = sfbAlways
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object dbgDealsDBTableView1DEOFIDSEND: TcxGridDBColumn
        DataBinding.FieldName = 'DEOFIDSEND'
        Width = 38
      end
      object dbgDealsDBTableView1DEOFIDDEST: TcxGridDBColumn
        DataBinding.FieldName = 'DEOFIDDEST'
        Width = 38
      end
      object dbgDealsDBTableView1DEID: TcxGridDBColumn
        DataBinding.FieldName = 'DEID'
        Width = 100
      end
      object dbgDealsDBTableView1DEWAYBILL: TcxGridDBColumn
        DataBinding.FieldName = 'DEWAYBILL'
        Width = 80
      end
      object dbgDealsDBTableView1S_CLIENT: TcxGridDBColumn
        DataBinding.FieldName = 'S_CLIENT'
        Width = 200
      end
      object dbgDealsDBTableView1R_CLIENT: TcxGridDBColumn
        DataBinding.FieldName = 'R_CLIENT'
        Width = 200
      end
      object dbgDealsDBTableView1DETYPE: TcxGridDBColumn
        DataBinding.FieldName = 'DETYPE'
        Width = 145
      end
      object dbgDealsDBTableView1STATUS: TcxGridDBColumn
        DataBinding.FieldName = 'STATUS'
        Width = 145
      end
    end
    object dbgDealsDBTableView2: TcxGridDBTableView
      OnDblClick = dbgDealsDBTableView1DblClick
      OnKeyDown = dbgDealsDBTableView1KeyDown
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      DataController.DataModeController.GridMode = True
      DataController.DataSource = dlgDS
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <>
      DataController.Summary.SummaryGroups = <>
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsBehavior.IncSearch = True
      OptionsData.Deleting = False
      OptionsData.Inserting = False
      OptionsView.Navigator = True
      OptionsView.NavigatorOffset = 10
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.ColumnAutoWidth = True
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      OptionsView.ShowColumnFilterButtons = sfbAlways
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object dbgDealsDBTableView2DEID: TcxGridDBColumn
        DataBinding.FieldName = 'DEID'
        Width = 100
      end
      object dbgDealsDBTableView2S_CLIENT: TcxGridDBColumn
        DataBinding.FieldName = 'S_CLIENT'
        Width = 200
      end
      object dbgDealsDBTableView2R_CLIENT: TcxGridDBColumn
        DataBinding.FieldName = 'R_CLIENT'
        Width = 200
      end
      object dbgDealsDBTableView2DEENTERED: TcxGridDBColumn
        DataBinding.FieldName = 'DEENTERED'
      end
      object dbgDealsDBTableView2DEDATEOUTSEND: TcxGridDBColumn
        DataBinding.FieldName = 'DEDATEOUTSEND'
        Width = 93
      end
      object dbgDealsDBTableView2DEDATERECIPIENT: TcxGridDBColumn
        DataBinding.FieldName = 'DEDATERECIPIENT'
        Width = 72
      end
      object dbgDealsDBTableView2DECOST: TcxGridDBColumn
        DataBinding.FieldName = 'DECOST'
        Width = 82
      end
      object dbgDealsDBTableView2DEBALANCE: TcxGridDBColumn
        DataBinding.FieldName = 'DEBALANCE'
        Width = 88
      end
    end
    object dbgDealsLevel1: TcxGridLevel
      Caption = #1053#1072#1082#1083#1072#1076#1085#1072#1103'-'#1058#1080#1087'-'#1057#1090#1072#1090#1091#1089
      GridView = dbgDealsDBTableView1
    end
    object dbgDealsLevel2: TcxGridLevel
      Caption = #1044#1072#1090#1099'-'#1057#1090#1086#1080#1084#1086#1089#1090#1100'-'#1041#1072#1083#1072#1085#1089
      GridView = dbgDealsDBTableView2
    end
  end
  inherited dlgDS: TDataSource
    DataSet = qDeals
    Left = 128
    Top = 296
  end
  object qOfSend: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterOpen = qOfSendAfterOpen
    SQL.Strings = (
      'SELECT -1 OFID, '#39' --- '#1042#1089#1077' '#1075#1086#1088#1086#1076#1072' ---'#39' OFNAMECALC,'
      '       '#39' '#39' OFTOWN'
      '  FROM OFFICES'
      'UNION'
      'SELECT OFID, '#39'{'#39'||OFINDEX||'#39'} '#39'||OFOFFICE OFNAMECALC,'
      '       OFTOWN'
      '  FROM OFFICES'
      ' ORDER BY 3')
    Left = 184
  end
  object qOfDest: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterOpen = qOfDestAfterOpen
    SQL.Strings = (
      'SELECT -1 OFID, '#39' --- '#1042#1089#1077' '#1075#1086#1088#1086#1076#1072' ---'#39' OFNAMECALC,'
      '       '#39' '#39' OFTOWN'
      '  FROM OFFICES'
      'UNION'
      'SELECT OFID, '#39'{'#39'||OFINDEX||'#39'} '#39'||OFOFFICE OFNAMECALC,'
      '       OFTOWN'
      '  FROM OFFICES'
      ' ORDER BY 3')
    Left = 408
  end
  object qDeals: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterOpen = qDealsAfterOpen
    BeforeOpen = qDealsBeforeOpen
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT D.DEID, D.DEOFIDSEND, D.DEOFIDDEST, D.DEENTERED, D.DEDATE' +
        'OUTSEND, D.DEDATEINSEND,'
      '       D.DEDATERECIPIENT, D.DECOST, D.DEBALANCE,'
      '       S.CLNAME S_CLIENT, R.CLNAME R_CLIENT, D.DEWAYBILL,'
      '       TY.SDNAME DETYPE, ST.SDNAME STATUS'
      '  FROM DEALS D'
      '  LEFT OUTER JOIN CLIENTS S ON (D.DECLID_S = S.CLID)'
      '  LEFT OUTER JOIN CLIENTS R ON (D.DECLID_R = R.CLID)'
      '  LEFT OUTER JOIN SYS_DIC TY ON (D.DETYPE = TY.SDID)'
      '  LEFT OUTER JOIN SYS_DIC ST ON (D.DESTATUS = ST.SDID)'
      ' WHERE D.DEID IS NOT NULL'
      '   AND D.DEOFIDSEND = :OFIDSEND'
      '   AND D.DEOFIDDEST = :OFIDDEST'
      
        '   AND NOT (D.DEDATERECIPIENT < (CURRENT_DATE - 62) AND (D.DEBAL' +
        'ANCE = 0.0) AND D.DEDATERECIPIENT IS NOT NULL)'
      ' ORDER BY D.DEID DESC')
    UpdateObject = quDeals
    Left = 152
    Top = 296
    ParamData = <
      item
        DataType = ftInteger
        Name = 'OFIDSEND'
        ParamType = ptUnknown
      end
      item
        DataType = ftInteger
        Name = 'OFIDDEST'
        ParamType = ptUnknown
      end>
    object qDealsDEID: TIntegerField
      DisplayLabel = #8470' '#1089#1076#1077#1083#1082#1080
      FieldName = 'DEID'
      Origin = '"DEALS"."DEID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qDealsDEOFIDSEND: TIntegerField
      DisplayLabel = #1055#1054
      FieldName = 'DEOFIDSEND'
      Origin = '"DEALS"."DEOFIDSEND"'
      DisplayFormat = '00'
    end
    object qDealsDEOFIDDEST: TIntegerField
      DisplayLabel = #1055#1053
      FieldName = 'DEOFIDDEST'
      Origin = '"DEALS"."DEOFIDDEST"'
      DisplayFormat = '00'
    end
    object qDealsDEENTERED: TDateTimeField
      DisplayLabel = #1047#1072#1074#1077#1076#1077#1085#1072
      FieldName = 'DEENTERED'
      Origin = '"DEALS"."DEENTERED"'
    end
    object qDealsDEDATEOUTSEND: TDateField
      DisplayLabel = #1054#1090#1087#1088#1072#1074#1083#1077#1085#1072
      FieldName = 'DEDATEOUTSEND'
      Origin = '"DEALS"."DEDATEOUTSEND"'
    end
    object qDealsDEDATERECIPIENT: TDateField
      DisplayLabel = #1042#1099#1076#1072#1085#1072
      FieldName = 'DEDATERECIPIENT'
      Origin = '"DEALS"."DEDATERECIPIENT"'
    end
    object qDealsDECOST: TIBBCDField
      DisplayLabel = #1057#1090#1086#1080#1084#1086#1089#1090#1100
      FieldName = 'DECOST'
      Origin = '"DEALS"."DECOST"'
      DisplayFormat = '#,##0.00'
      EditFormat = '0.00'
      Precision = 18
      Size = 2
    end
    object qDealsDEBALANCE: TIBBCDField
      DisplayLabel = #1041#1072#1083#1072#1085#1089
      FieldName = 'DEBALANCE'
      Origin = '"DEALS"."DEBALANCE"'
      DisplayFormat = '#,##0.00'
      EditFormat = '0.00'
      Precision = 18
      Size = 2
    end
    object qDealsS_CLIENT: TIBStringField
      DisplayLabel = #1054#1090#1087#1088#1072#1074#1080#1090#1077#1083#1100
      FieldName = 'S_CLIENT'
      Origin = '"CLIENTS"."CLNAME"'
      Size = 255
    end
    object qDealsR_CLIENT: TIBStringField
      DisplayLabel = #1055#1086#1083#1091#1095#1072#1090#1077#1083#1100
      FieldName = 'R_CLIENT'
      Origin = '"CLIENTS"."CLNAME"'
      Size = 255
    end
    object qDealsDETYPE: TIBStringField
      DisplayLabel = #1058#1080#1087
      FieldName = 'DETYPE'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qDealsSTATUS: TIBStringField
      DisplayLabel = #1057#1090#1072#1090#1091#1089
      FieldName = 'STATUS'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qDealsDEWAYBILL: TIBStringField
      DisplayLabel = #1053#1072#1082#1083#1072#1076#1085#1072#1103
      FieldName = 'DEWAYBILL'
      Origin = '"DEALS"."DEWAYBILL"'
    end
    object qDealsDEDATEINSEND: TDateTimeField
      FieldName = 'DEDATEINSEND'
      Origin = '"DEALS"."DEDATEINSEND"'
    end
  end
  object quDeals: TIBUpdateSQL
    DeleteSQL.Strings = (
      'delete from DEALS'
      'where'
      '  DEID = :OLD_DEID')
    Left = 176
    Top = 296
  end
end
